home *** CD-ROM | disk | FTP | other *** search
- Path: news.uni-jena.de!news
- From: mkt@isun04.inf.uni-jena.de (Tilo Koerbs)
- Newsgroups: comp.lang.c++
- Subject: Re: NEWBIE:strings, spacing, white_spacing
- Date: 2 Feb 1996 14:53:02 GMT
- Organization: Lehrstuhl fuer Rechnerarchitektur- und kommunikation, FSU Jena
- Message-ID: <4et8ge$hg9@fsuj01.rz.uni-jena.de>
- References: <4esavf$sqb@cloner4.netcom.com>
- Reply-To: mkt@isun04.inf.uni-jena.de
- NNTP-Posting-Host: isun07.inf.uni-jena.de
-
- To read a whole line you cannot use cin.operator>> .
- It reads only to the next white space (spaces, tabs, new-lines, etc.).
- You must use cin.getline (or cin.get) to read a whole line:
- cin.getline(buf, buf_len); // read until newline or
- // until buf_len - 1 characters are read.
- The fct prototype is something like: getline(char *, int, .../* I don't know yet */);
-
- Bye.
- Tilo Koerbs
-
-
-
-